package com.oig.sys.base.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.oig.common.validator.GroupAdd;
import com.oig.common.validator.GroupEdit;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

@Schema
@Data
public class HsGoodsTariffDto {
    @Schema(description = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "参数错误,id不能为空", groups={GroupEdit.class})
    private Integer id;
    @Schema(description = "hsCode", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误,hsCode不能为空", groups={GroupAdd.class, GroupEdit.class})
    private String hsCode;
    @Schema(description = "国家code")
    private String countryCode;
    @Schema(description = "国家applyCode")
    private String countryApplyCode;
    @Schema(description = "国家名称")
    private String countryName;
    @Schema(description = "进口关税税率", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "进口关税税率必填", groups={GroupAdd.class,GroupEdit.class})
    private BigDecimal tariffRate;
    @Schema(description = "关税收取方式 0-从价 1-从量")
    private String tariffType;
    @Schema(description = "备注")
    private String remark;

    @Schema(description = "创建人id")
    private Integer createUserId;

    @Schema(description = "创建人")
    private String createUserName;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "最后更新人id")
    private Integer lastUpdateId;

    @Schema(description = "最后更新人")
    private String lastUpdateName;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(description = "最后更新时间")
    private Date lastUpdateTime;

    @Schema(description = "国别组Id")
    private Integer countryGroupId;

    @Schema(description = "国别组名称")
    private String countryGroupName;

    @Schema(description = "优先级")
    private Integer priority = 0;//优先级
}
